import { useEffect, useState } from 'react';
import BizHeader from '@inbiz/basic/BizHeader';
import BizBody from '@inbiz/basic/BizBody';
import './index.less';

export const Html = (props: any) => {
  const { disposition, className } = props;

  const [html, sethtml] = useState('');

  useEffect(() => {
    sethtml(disposition);
    return () => { };
  }, [disposition]);

  return (
    <>
      <div className={`inbiz-html ${className}`}>
        <BizHeader {...props} />
        <BizBody {...props}>
          <div
            className="inbiz-html-content"
            dangerouslySetInnerHTML={{ __html: unescape(html) }}
          ></div>
        </BizBody>
      </div>
    </>
  );
};
export default Html;
